Skip to content

Comments

Handle missing multivector distance#479

Open
tomjohnhall wants to merge 2 commits intoredis:mainfrom
tomjohnhall:handle-missing-multivector-distance
Open

Handle missing multivector distance#479
tomjohnhall wants to merge 2 commits intoredis:mainfrom
tomjohnhall:handle-missing-multivector-distance

Conversation

@tomjohnhall
Copy link

When running a multi vector query, I noticed redis would sometimes return:

Could not find the value for a parameter name, consider using EXISTS if applicable for distance_2

This is running redis-stack-server/7.4.0-v8 from brew.

I confirmed all documents contained the referenced embedding fields, but somehow the third distance was not always calculated and the query would error out. Maybe a match in other distances causes redis to skip the final distance calculation? Without debugging the specifics of query execution, this PR adds a case() in the query to set a default score of 0 for missing distances.

I also noticed that the vector radius is always hard coded to 2.0 - looks like there's a separate PR just opened to add custom ranges so I've left those changes out here. This fallback may solve issues downstream of that, and allow for safer handling of OR multi vectors of different ranges, rather than forcing AND.

@jit-ci
Copy link

jit-ci bot commented Feb 20, 2026

Hi, I’m Jit, a friendly security platform designed to help developers build secure applications from day zero with an MVS (Minimal viable security) mindset.

In case there are security findings, they will be communicated to you as a comment inside the PR.

Hope you’ll enjoy using Jit.

Questions? Comments? Want to learn more? Get in touch with us.

@tomjohnhall
Copy link
Author

I realise now that on a fresh instance, unstable features needs to be enabled to use case():

FT.CONFIG SET ENABLE_UNSTABLE_FEATURES true

So this change would be breaking until that feature becomes stable

@vishal-bala
Copy link
Collaborator

vishal-bala commented Feb 20, 2026

Hey @tomjohnhall, thanks for jumping on that! You're right that these changes are breaking until the case() becomes part of the stable feature-set. The changes you have here are more of a workaround to deal with an unclear underlying issue - that some vectors are sometimes erroring out when you wouldn't expect them to.

If there isn't already one, could you raise an issue about that (along with a way to reproduce it, if you have one)? Once we have that, hopefully someone from our team, you, or someone else in the community can identify what's going on there and resolve it properly 🤞

@tomjohnhall
Copy link
Author

Thanks @vishal-bala I've narrowed it down to an issue of scale, not number of vectors / missing values. Raised issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants